<template>
  <van-nav-bar @click-left="$router.push(path)" @click-right="rightEvent">
    <template #left>
      <i class="iconfont f44" v-if="icon" v-html="icon"></i>
    </template>
    <template #title>
      <div class="title">{{title}}</div>
    </template>
    <template #right>
      <div class="right">{{right}}</div>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  name: 'navBar',
  // props: ['title', 'path', 'right'],
  props: {
    title: {
      type: String
    },
    path: {
      type: String
    },
    right: {
      type: String
    },
    icon: {
      typ: String,
      default: '&#xe637;'
    }
  },
  methods: {
    rightEvent () {
      this.$emit('rightClick')
    }
  }
}
</script>

<style lang="less" scoped>
  .f44{
    font-size: 44px;
  }
  .title {
    font-size: 18px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 600;
    text-align: left;
    color: #222222;
    line-height: 25px;
    letter-spacing: 0px;
  }
  ::v-deep .van-nav-bar__left,
  ::v-deep .van-nav-bar__right{
    padding: 0;
  }
  ::v-deep .van-field__left-icon {
    margin:0 20px;
  }
  .right {
    padding-right: @p15;
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #181a39;
    line-height: 20px;
    letter-spacing: 0px;
  }
</style>
